<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('AdminIndex/index')}">{:lang('TENANT_USER')}</a></li>
			<li><a href="{:url('AdminIndex/add')}">新增{:lang('TENANT_USER')}</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="get" action="{:url('AdminIndex/index')}">
            用户名:
            <input type="text" class="form-control" name="name" style="width: 120px;" value="{:input('request.name/s','')}" placeholder="请输入{:lang('USERNAME')}">
            地区:
            <input type="text" class="form-control" name="area_value" style="width: 120px;" value="{:input('request.area_value/s','')}" placeholder="请输入地区">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:url('AdminIndex/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th>{:lang('USERNAME')}</th>
					<th>性别</th>
					<th>年龄</th>
					<th>电话</th>
					<th>地区</th>
					<th>微信号</th>
                    <th>标签</th>
                    <th>跟进次数</th>
					<th>沟通状态</th>
					<th width="140">{:lang('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="users" item="vo">
				<tr>
                    <td>{$vo.name}</td>
					<td>{$vo.sex}</td>
					<td>{$vo.age}</td>
					<td>{$vo.tel}</td>
					<td>{$vo.area_value}</td>
					<td>{$vo.wechat_id}</td>
					<php>
						$tags = explode(',',$vo['tag_id']);
					</php>
					<td>
						<foreach name="tags" item="t">
							<span class="label label-default">{$t}</span>
						</foreach>
					</td>
					<td>{$vo.communicate_times}</td>
                    
					<td>
						<switch name="vo.status">
							<case value="0">
								<span class="label label-warning">待跟进</span>
							</case>
							<case value="1">
								<span class="label label-success">正常</span>
                            </case>
                            <case value="2">
								<span class="label label-danger">无效</span>
							</case>
                        </switch>
                        <a class="btn btn-xs btn-primary" href="javascript:parent.openIframeLayer('{:url('AdminIndex/records',array('id'=>$vo['id']))}','跟进{$vo.name}',{area: ['800px', '600px']});">跟进</a>
					</td>
					
					<td>
                        
							<a class="btn btn-xs btn-primary" href='{:url("AdminIndex/edit",array("id"=>$vo["id"]))}'>修改</a>
							<a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('AdminIndex/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
        </table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>